﻿@model List<PopForums.Models.SecurityLogEntry>

@{
    ViewBag.PageTitle = PopForums.Resources.SecurityLog;
    Layout = "~/Areas/PopForums/Views/Admin/AdminMaster.cshtml";
}

<h1>@PopForums.Resources.SecurityLog</h1>

@using (Html.BeginForm()) {
	<table class="settings">
		<tr>
			<td>@PopForums.Resources.StartDate</td>
			<td>@Html.TextBox("startDate")</td>
		</tr>
		<tr>
			<td>@PopForums.Resources.EndDate</td>
			<td>@Html.TextBox("endDate")</td>
		</tr>
		<tr>
			<td>
				@Html.RadioButton("searchType", "Name", true, new {id="Name"})<label for="Name">@PopForums.Resources.Name</label>
				@Html.RadioButton("searchType", "UserID", new {id="UserID"})<label for="UserID">@PopForums.Resources.UserID</label>
			</td>
			<td>@Html.TextBox("searchTerm")</td>
		</tr>
		<tr>
			<td></td>
			<td><input type="submit" value="@PopForums.Resources.Search" /></td>
		</tr>
	</table>
}

@if (Model != null && Model.Count > 0) {

	<table class="stripe">
		<tr>
			<th>@PopForums.Resources.EventTime</th>
			<th>@PopForums.Resources.Event</th>
			<th>@PopForums.Resources.UserID</th>
			<th>@PopForums.Resources.UserIDTarget</th>
			<th>@PopForums.Resources.IP</th>
			<th>@PopForums.Resources.Message</th>
		</tr>
	@foreach (var entry in Model) {
		<tr>
			<td style="white-space: nowrap">@entry.ActivityDate</td>
			<td>@entry.SecurityLogType.ToString()</td>
			<td>@entry.UserID</td>
			<td>@entry.TargetUserID</td>
			<td>@entry.IP</td>
			<td>@entry.Message</td>
		</tr>
	}
	</table>

}